def read_file(file_path):
    """读取文件并返回文件内容的列表"""
    with open(file_path, 'r', encoding='utf-8') as file:
        return [line.strip() for line in file]


def find_absent_students(today_list, class_list):
    """找出没来的人并返回名单"""
    today_set = set(today_list)
    class_set = set(class_list)
    absent_students = class_set - today_set
    return sorted(absent_students)


def main():
    today_list_path = 'today_list.txt'
    class_list_path = 'class_list.txt'

    today_list = read_file(today_list_path)
    class_list = read_file(class_list_path)

    absent_students = find_absent_students(today_list, class_list)

    if absent_students:
        print("没来的人的名单:")
        for student in absent_students:
            print(student)
    else:
        print("今天所有学生都来了！")


if __name__ == "__main__":
    main()
    main()